<?xml version='1.0' encoding='UTF-8' ?>
<ui:composition template="template-with-sidebar.xhtml" xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ice="http://www.icesoft.com/icefaces/component"
                xmlns:odr="http://java.sun.com/jsf/composite/odr">

    <ui:define name="head">
    </ui:define>

    <ui:define name="pagetitle">
        <ice:outputText value="#{page['concern.page.title']}" nospan="true" />
    </ui:define>

    <ui:define name="content">

        <odr:breadcrumb breadCrumbSource="#{concernController.navigationBar}" />

        <ice:form id="concernForm" partialSubmit="false" rendered="#{concernController.valid}">
            <h1><h:outputText value="#{concernController.concern.name}"/></h1>
            <table class="details">

                <div class="projectDetailsActions">
                    <a href="#{concernController.createLink}" id="createLink" style="text-decoration: none;">
                        <img alt="#{common.create}" title="#{page['concern.actions.create.title']}" class="vtip" src="./resources/images/add_small.png" width="38" height="38" />
                    </a>
                    <a href="#{concernController.updateLink}" id="updateLink" style="text-decoration: none;">
                        <img alt="#{common.edit}" title="#{page['iteration.actions.edit.title']}" class="vtip" src="./resources/images/pencil.png" width="38" height="38" />
                    </a>
                </div>

                <tbody>
                    <tr>
                        <td><ice:outputLabel value="#{form['label.concern.number']}" for="inExternalNumber" /></td>
                <td> <ice:outputText value="#{concernController.concern.externalId}"/></td>
                </tr>
                <tr>
                    <td><ice:outputLabel value="#{form['label.name']}" for="inName" /></td>
                <td><ice:outputText value="#{concernController.concern.name}">
                </ice:outputText>
                </td>
                </tr>
                <tr>
                    <td><ice:outputLabel value="#{form['label.description']}" for="inDescription" /></td>
                <td><ice:outputText value="#{concernController.concern.description}">
                </ice:outputText>
                </td>
                </tr>
                <tr>
                    <td><ice:outputLabel value="#{form['label.tags']}" for="inTags" /></td>
                <td><ul> <ice:repeat value="#{concernController.concern.tags}" var="tag">
                            <li><ice:outputText value="#{tag}"/></li>
                        </ice:repeat></ul></td>
                </tr>

                <tr>
                    <td><ice:outputLabel value="#{form['label.initiators']}" for="inCreator" /></td>
                <td><ice:outputText value="#{concernController.concern.initiators.person.name}">
                </ice:outputText>
                </td>
                </tr>

                <tr>
                    <td><ice:outputLabel value="#{form['concern.creationdate']}" for="inCreationDate" /></td>
                <td><ice:outputText value="#{concernController.concern.createdWhen}">
                    <f:convertDateTime type="date" pattern="#{common['format.date.time']}" timeZone="#{timeZoneController.timeZone}" />
                </ice:outputText>
                </td>
                </tr>

                </tbody>
            </table>

            <!--Back Button-->
            <ice:commandButton actionListener="#{concernController.abortForm}"
                               id="reset"
                               style="margin-top:10px"
                               value="#{form['button.backtoproject']}"
                               immediate="true"
                               partialSubmit="true"
                               type="abort" />
        </ice:form>
    </ui:define>

    <!--SIDEBAR-->
    <ui:define name="sidebar">
        <div id="help">
            <ul class="info">
                <li class="messages">
                    <div class="header"></div>
                    <div class="text">
                        <ice:messages layout="list"
                                      errorClass="error"
                                      warnClass="warning"
                                      fatalClass="fatal"
                                      infoClass="information" />
                    </div>
                </li>
                <li>
                    <div class="header">
                        <img src="resources/images/info.png" alt="information" />
                    </div>
                    <div class="text">
                     <ice:form>
                         <h2><ice:outputText value="#{page['help.concern.head']}" nospan="true"/></h2>
                         <ice:outputText value="#{page['help.concern.view']}" nospan="true" escape="false"/>
                    </ice:form>
                    </div>
                </li>
            </ul>
        </div>
    </ui:define>
</ui:composition>